//
//  NewAllNetManager.m
//  digitalCurrency
//
//  Created by 小震GG on 2019/11/8.
//  Copyright © 2019 XinHuoKeJi. All rights reserved.
//

#import "NewAllNetManager.h"

@implementation NewAllNetManager

//矿机列表
+(void)kuangJiList:(NSString *)classId pageNumStr:(NSString *)pageNum pageSizeStr:(NSString *)pageSize CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"getCommodities";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"classId"] = classId;
    dic[@"pageNum"] = pageNum;
    dic[@"pageSize"] = pageSize;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

//商城banner
+(void)shangChengBanner:(NSString *)token CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"storeBanner";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

//我的矿机
+(void)myKuangJi:(NSString *)pageNum pageSizeStr:(NSString *)pageSize CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"myMills";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"pageNum"] = pageNum;
    dic[@"pageSize"] = pageSize;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
           completeHandle(resultObject,isSuccessed);
    }];
}

//矿机记录
+(void)KuangJiRecord:(NSString *)pageNum pageSizeStr:(NSString *)pageSize CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"millIncomes";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"pageNum"] = pageNum;
    dic[@"pageSize"] = pageSize;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
           completeHandle(resultObject,isSuccessed);
    }];
}

//矿机详情
+(void)KuangJiInfo:(NSString *)orderId CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle
{
    NSString *path = @"millDetail";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"orderId"] = orderId;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

//购买矿机
+(void)KuangJiBuy:(NSString *)commodityId commodityNumStr:(NSString *)commodityNum payPasswordStr:(NSString *)payPassword codeStr:(NSString *)code CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"addOrder";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"commodityId"] = commodityId;
    dic[@"commodityNum"] = commodityNum;
    dic[@"payPassword"] = payPassword;
    dic[@"code"] = code;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
           completeHandle(resultObject,isSuccessed);
    }];
}

//矿机列表banner
+(void)kuangJiBanner:(NSString *)token CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    NSString *path = @"millBanner";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
        completeHandle(resultObject,isSuccessed);
    }];
}

//地址管理
+(void)addressManage:(NSString *)pageNum pageSizeStr:(NSString *)pageSize CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle{
    
    NSString *path = @"myAddress";
       NSMutableDictionary *dic = [NSMutableDictionary new];
       dic[@"pageNum"] = pageNum;
       dic[@"pageSize"] = pageSize;
       [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
              completeHandle(resultObject,isSuccessed);
       }];
}

//删除地址
+(void)deleteAddressManage:(NSString *)idStr CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle
{
    NSString *path = @"my_addresses/delete";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"my_address_id"] = idStr;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
           completeHandle(resultObject,isSuccessed);
    }];
}

//修改地址
+(void)editAddressManage:(NSString *)idStr addressStr:(NSString *)address remarksStr:(NSString *)remarks CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle
{
    NSString *path = @"my_addresses/edit";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"id"] = idStr;
    dic[@"address"] = address;
    dic[@"remarks"] = remarks;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
           completeHandle(resultObject,isSuccessed);
    }];
}

//我的订单
+(void)myOrderList:(NSString *)pageNum pageSizeStr:(NSString *)pageSize CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle
{
    NSString *path = @"myOrder";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"pageNum"] = pageNum;
    dic[@"pageSize"] = pageSize;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
           completeHandle(resultObject,isSuccessed);
    }];
}

//获取节点矿机
+(void)nodeKuangJi:(NSString *)classId pageNumStr:(NSString *)pageNum pageSizeStr:(NSString *)pageSize CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle
{
    NSString *path = @"getNodeCommodities";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"classId"] = classId;
    dic[@"pageNum"] = pageNum;
    dic[@"pageSize"] = pageSize;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
           completeHandle(resultObject,isSuccessed);
    }];
}

//升级节点
+(void)upNodeBuy:(NSString *)commodityId payPasswordStr:(NSString *)payPassword codeStr:(NSString *)code invCodeStr:(NSString *)invCode CompleteHandle:(void(^)(id resPonseObj,int code))completeHandle
{
    NSString *path = @"upNode";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    dic[@"commodityId"] = commodityId;
    dic[@"invCode"] = invCode;
    dic[@"payPassword"] = payPassword;
    dic[@"code"] = code;
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
           completeHandle(resultObject,isSuccessed);
    }];
}

//我的节点信息
+(void)myNodeCompleteHandle:(void(^)(id resPonseObj,int code))completeHandle
{
    NSString *path = @"myNode";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
           completeHandle(resultObject,isSuccessed);
    }];
}
//我的深度
+(void)myDepthCompleteHandle:(void(^)(id resPonseObj,int code))completeHandle
{
    NSString *path = @"myDepth";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
           completeHandle(resultObject,isSuccessed);
    }];
}

//我的宽度
+(void)myWidthCompleteHandle:(void(^)(id resPonseObj,int code))completeHandle
{
    NSString *path = @"myWidth";
    NSMutableDictionary *dic = [NSMutableDictionary new];
    [self ylNonTokenRequestWithGET:path parameters:dic successBlock:^(id resultObject, int isSuccessed) {
           completeHandle(resultObject,isSuccessed);
    }];
}


@end
